<?php

class indexController extends Controller {

    public $initphp_list = array(
        'feed'
    );
    private $conf;
    public function __construct(){
        parent::__construct();
        $this->conf=InitPHP::getConfig();
        $this->view->assign("nav", $this->getNav()->getNav(tree,1));
        $this->view->assign("slide", $this->getSlide()->getAll());
        $this->view->assign("link", $this->getLink());
        $this->view->assign("pro_cat",$this->getProduct()->getMenu());
        $this->default_description="厦门凯巴斯（KABASI）重载连接器在设计、制造过程中不断吸纳国际先进技术和设计理念，保证能够为客户提供高性能、高品质的工业连接器，并不断推出HA、HD、HE、HEE、HK、HQ等矩形连接器接插件，且通过CE、ROHS、CCC等认证，其各种组合达到数千种，能满足不同领域、不同场合的电气或者信号连接的要求。";
        $this->default_keywords="工业连接器 ,矩形连接器 ,防水连接器 ,凯巴斯重载连接器,KABASI工业连接器";
    }
    public function run() {
        $about=$this->getPager()->getOne(1);
        $this->view->assign("about", $about);
        $pro_list=$this->getProduct()->getCatTree(false);
        $tj_product=$this->getProduct()->getTjPro();
        $this->view->assign("tj_pro", $tj_product);
        $cat=$this->getProduct()->getCatTree2(false);
        $this->view->assign("cat", $cat);
        $this->view->assign("pro_list", $pro_list);
        $newsData=$this->getNews()->getNews(1);
        $hyzx=$this->getNews()->getNews(2,6);
        $this->view->assign("news", $newsData);
        $this->view->assign("hyzx", $hyzx);
        $this->view->assign("title", "矩形防水工业连接器_凯巴斯KABASI重载连接器-厦门凯巴斯电气有限公司");
        $this->view->assign("keywords", $this->default_keywords);
        $this->view->assign("description", $this->default_description);
        $this->view->set_tpl("home/index"); // 中间的模板
        $this->view->display();
    }
    public function feed(){
        $this->view->assign("title", "留言板-".$this->conf['title']);
        $this->view->assign("keywords", $this->default_keywords);
        $this->view->assign("description", $this->default_description);
        $this->view->set_tpl("home/feed");
        $this->view->display();
    }
    /**
     * 
     * @return navService
     */
    private function getNav(){
        return InitPHP::getService("nav");
    }
    /**
     *
     * @return pagerService
     */
    private function getPager(){
        return InitPHP::getService("pager");
    }
    /**
     *
     * @return newsService
     */
    private function getNews(){
        return InitPHP::getService("news");
    }
    /**
     * 
     * @return productService
     */
    private function getProduct(){
        return InitPHP::getService("product");
    }
    /**
     * 
     * @return slideService
     */
    private function getSlide(){
        return InitPHP::getService("slide");
    }
    private function getLink(){
        return InitPHP::getDao("link")->getAll();
    }

}